package com.oba.king.datalib;

import com.oba.base.dao.BaseDao;
import com.oba.base.interfaces.IHsqlBuilder;

public class CompanyInfoDao extends BaseDao {

	public IHsqlBuilder findAll() {
		return getSqlBuilder("from CompanyInfo c order by c.companyName");
	}

	public IHsqlBuilder findByCompany(CompanyCondition companyCondition) {
		IHsqlBuilder sql = getSqlBuilder("from CompanyInfo c");
		sql.add("c.companyName like ?", companyCondition.getCompanyName(), "%", "%");
		sql.add("c.accountValue.accountNumber = ?",companyCondition.getAccountNumber());
		sql.addend("order by c.companyName");
		return sql;

	}

}
